<template>
  <div class="head">
    <input type="text" v-model="msg">
    <button @click="add">添加</button>
  </div>
</template>

<script setup>
import { ref } from 'vue'
const msg = ref('')
const props = defineProps(['list'])
const emits = defineEmits(['update:a'])
const add = () => {
  const arr = props.list
  arr.push('vue')
  emits('update:a', arr)
}


</script>

<style lang="css" scoped></style>